package cn.myschool.dao;

import cn.myschool.entity.Grade;
import cn.myschool.util.DBUtil;

/**
 * @author oldliu
 * @since 1.0
 */
public class GradeDao {
    public int add(Grade g){
        //int []a={1,2,345};
        //int []a2=new int[]{1,2,345};
        String sql="insert into s_grade(gname)values(?)";
        return DBUtil.executeUpdate(sql,new Object[]{g.getGname()});
    }
    public int update(Grade g){
        String sql="update s_grade set  gname=? where id=?";
        return DBUtil.executeUpdate(sql,new Object[]{g.getGname(),g.getId()});
    }
    public int del(long id){
        String sql="delete from s_grade  where id=?";
        return DBUtil.executeUpdate(sql,new Object[]{id});
    }

}
